package com.hccl.mongoEntities.action;

import DM.StateMachine;

/**
 * Created by xjzhang on 2017/12/1.
 */
public class ClearParamValue extends Action {

    public ClearParamValue(){
        super();
    }

    @Override
    public void run(StateMachine stateMachine) throws Exception{
        try{
            onEnter(stateMachine);
            for (String str : actionParams){
                if (stateMachine.getStatementParamMap().get(actionParams.get(0)) != null)
                    stateMachine.getStatementParamMap().get(actionParams.get(0)).setValue("");
                if(stateMachine.getBindings().get(str) !=null )
                    stateMachine.getBindings().remove(str);
                
            }

        }finally {
            onExit(stateMachine);
        }

    }
}
